From a346999a2d2781246a5cf9b63847d46c874ed7e4 Mon Sep 17 00:00:00 2001 From: "kaf24@scramble.cl.cam.ac.uk" Date: Tue, 3 Aug 2004 09:36:46 +0000 Subject: [PATCH] bitkeeper revision 1.1108.33.41 (410f5cae_2UrWZA0rcb91kIdTgrTFg) Debug builds of Xen now reverse DOM0's address space, to trigger those hard-to-find bugs. --- xen/arch/x86/domain.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 6f6b7b620f..768d25c49c 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -772,11 +772,14 @@ int construct_dom0(struct domain *p, si->mfn_list = vphysmap_start; /* Write the phys->machine and machine->phys table entries. */ - for ( mfn = (alloc_start>>PAGE_SHIFT); - mfn < (alloc_end>>PAGE_SHIFT); - mfn++ ) + for ( pfn = 0; pfn < p->tot_pages; pfn++ ) { - pfn = mfn - (alloc_start>>PAGE_SHIFT); + mfn = pfn + (alloc_start>>PAGE_SHIFT); +#ifndef NDEBUG +#define REVERSE_START ((v_end - v_start) >> PAGE_SHIFT) + if ( pfn > REVERSE_START ) + mfn = (alloc_end>>PAGE_SHIFT) - (pfn - REVERSE_START); +#endif ((unsigned long *)vphysmap_start)[pfn] = mfn; machine_to_phys_mapping[mfn] = pfn; } -- 2.30.2